<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\common\model\Menu;
use app\common\controller\Backend;
use think\facade\Session;

class Index extends Backend
{
    //后台首页
    public function index()
    {
        return view('index/index', ['admin' => session('admin'), 'menus' => app(Menu::class)->toTree()]);
    }

    public function logout()
    {
        Session::set("admin", null);
        $this->redirect('/admin/index');
    }
}
